package hotciv.winningstrategies;

import hotciv.framework.City;
import hotciv.framework.GameContext;
import hotciv.framework.Player;
import hotciv.framework.WinningStrategy;

import java.util.Enumeration;

public class CityConquerWinningStrategy implements WinningStrategy
{
	@Override
	public Player getWinner(GameContext g) 
	{
		Enumeration<City> citys = g.getAllCitys();
		City c = citys.nextElement();
		
		while(citys.hasMoreElements())
		{
			if(citys.nextElement().getOwner() != c.getOwner())
			{
				return null;
			}
		}
		return c.getOwner();
	}

}
